<template>
    <el-pagination 
        background 
        layout="prev, pager, next" 
        :total="total" 
        @current-change="handleCurrentChange" />
</template>
<script setup lang="ts">
import { defineProps, defineEmits } from 'vue'; 
const props = defineProps({
  total: {
    type: Number,
    required: true, // 表示父组件必须传递该属性
  },
}); 
const emit = defineEmits(['page-change']);

const handleCurrentChange = (val: number) => {
    emit('page-change', val);
}
</script>
<style scoped>
.el-pagination {
    margin: 15px auto;
}
</style>